#pragma once

#include "apdu.h"
#include "apdu_mgr_base.h"

class apdu_dev_manager : public apdu_mgr_base
{
public:
	apdu_dev_manager(void);
	~apdu_dev_manager(void);

public:
	apdu * create_apdu_set_label(char * label);

	apdu * create_apdu_set_serial_num( char * serialNumber );

	apdu * create_apdu_get_dev_info();

	apdu * create_apdu_dev_auth(unsigned char algo, unsigned char * auth_data, int data_len);

	apdu * create_apdu_change_dev_auth_key(unsigned char algo, unsigned char * secure_new_auth_key, int data_len);

	apdu * create_apdu_change_dev_auth_key_ex(unsigned char * new_auth_key, int data_len );

	apdu * create_apdu_get_pin_info(unsigned char pin_type, int app_id);

	apdu * create_apdu_change_pin(unsigned char * random, unsigned char pin_type, int app_id, 
		char * old_pin, char * new_pin);

	apdu * create_apdu_verify_pin(unsigned char * random, unsigned char pin_type, 
		int app_id, char * pin);

	apdu * create_apdu_change_pin_ms(unsigned char pin_type, int app_id, unsigned char * acknowlege, int ack_len, unsigned char * new_pin, int nNew_pinLen);

	apdu * create_apdu_verify_pin_ms(unsigned char pin_type, int app_id, unsigned char * acknowlege, int ack_len);

	apdu * create_apdu_unblock_pin_ms(int app_id, unsigned char * acknowlege, int ack_len, char * new_upin);

	apdu * create_apdu_unblock_pin(unsigned char * random, int app_id, 
		char * admin_pin, char * new_upin);

	apdu * create_apdu_reload_pin( unsigned char random[16], int app_id, char * new_upin );

	apdu * create_apdu_remote_unblock_pin(int app_id, unsigned char * cipher, int cipher_len);

	apdu * create_apdu_clear_secure_state(int app_id);

	//mode = 0: clear all  1: SOPIN  2: USER PIN
	apdu * create_apdu_clear_secure_state_ex(int app_id, int mode);

	apdu * create_apdu_sys_led_control(int state, int interval);

	apdu * create_apdu_get_short_dev_info();

};
